USE [Bases2]
GO
/****** Object:  StoredProcedure [dbo].[getOPERADOR]    Script Date: 12/01/2011 14:11:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[getOPERADOR] @id INT
AS

BEGIN

SELECT id_cuenta, '<font color=green><b>' + CAST(id_cheque AS VARCHAR) + '</b></font>' as Procesados, monto, estado
FROM [FOLIO_CHEQUE]
where ESTADO = 'debitado'
AND id_folio = @id
UNION ALL

SELECT 0, '<b>Rechazados<b>',0, ''

UNION ALL

SELECT id_cuenta, '<font color=red><b>' + CAST(id_cheque AS VARCHAR) + '</b></font>' as Procesados,monto, estado
FROM [FOLIO_CHEQUE]
where ESTADO LIKE '%rechazado%'
AND id_folio = @id
END

--getoperador 1